package cn.jdy.platform.entity;

import cn.jdy.common.bo.BaseEntry;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import java.io.Serializable;

/**
 * 新闻实体类 
 * 
 * @author wuzhiliang
 */
@Entity
public class CopyOfNews extends BaseEntry implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)//根据数据库自动适配 mysql默认自增
	private Long id;        //主键
	private String title;      //标题
	private String author;      //作者
	@Column(columnDefinition = "longtext")
	private String context;      //内容
	private String summary;      //摘要
	private String keyword;      //关键词
	private String originAddress;  //来源
	@Column(updatable = false) // 第一次增加之后不可修改
	private String userid;      //发布人
	private String username;    //发布人
	private Integer readTimes;    //阅读次数
	private Integer goodtimes;    //点蛅次数
	private String imgUrl;      //封面图片地址
	private String status;      //状态 0：无效/未审核，1：有效/审核通过/未复签，2：审核不过, 3: 置顶（每一分类仅一条消息能被置顶），4：已复签
//新增属性
	private String openStatus;
//	文件公开属性--5：主动公开，6：申请公开，7：不予公开
	private String[] departments=new String[46];; //投稿部门
//	private String[] locations=new String[13];; //投稿所在辖区
	private String falseCreateTime;//假时间
	private String depars;//将部门由数组转换成字符串
	private String transforms;//是否写入Associations和RemoteAssociations,已写设置为1，
	
	@Column(nullable = false)
	private Long columnId;

	@ManyToOne
	@JoinColumn(name = "columnId", insertable = false, updatable = false)
	private ConfValue cv;
	
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public ConfValue getCv() {
		return cv;
	}

	public void setCv(ConfValue cv) {
		this.cv = cv;
	}

	public String getImgUrl() {
		return imgUrl;
	}

	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl;
	}

	public Integer getGoodtimes() {
		return goodtimes;
	}

	public void setGoodtimes(Integer goodtimes) {
		this.goodtimes = goodtimes;
	}

	public Integer getReadTimes() {
		return readTimes;
	}

	public void setReadTimes(Integer readTimes) {
		this.readTimes = readTimes;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getUserid() {
		return userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

	public String getOriginAddress() {
		return originAddress;
	}

	public void setOriginAddress(String originAddress) {
		this.originAddress = originAddress;
	}

	public String getKeyword() {
		return keyword;
	}

	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	public String getContext() {
		return context;
	}

	public void setContext(String context) {
		this.context = context;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getColumnId() {
		return columnId;
	}

	public void setColumnId(Long columnId) {
		this.columnId = columnId;
	}

	public String getOpenStatus() {
		return openStatus;
	}

	public void setOpenStatus(String openStatus) {
		this.openStatus = openStatus;
	}

	public String[] getDepartments() {
		return departments;
	}

	public void setDepartments(String[] departments) {
		this.departments = departments;
	}

//	public String[] getLocations() {
//		return locations;
//	}
//
//	public void setLocations(String[] locations) {
//		this.locations = locations;
//	}

	public String getFalseCreateTime() {
		return falseCreateTime;
	}

	public void setFalseCreateTime(String falseCreateTime) {
		this.falseCreateTime = falseCreateTime;
	}

	public String getDepars() {
		return depars;
	}

	public void setDepars(String depars) {
		this.depars = depars;
	}

	public String gettransforms() {
		return transforms;
	}

	public void settransforms(String transforms) {
		this.transforms = transforms;
	}
	
}
